package dao;

import java.util.ArrayList;

import javax.persistence.EntityManager;
import javax.persistence.Query;

public class TimetableDAO {
	private EntityManager em;
	
	public TimetableDAO(EntityManager em) {
		this.em = em;
	}
	
	public void updateEntityManager(EntityManager em){
		this.em = em;
	}
	
	public ArrayList<Timetable> searchAll(){
		Query query = em.createNamedQuery("searchAll");
		
	    ArrayList<Timetable> colTimetable = (ArrayList<Timetable>)query.getResultList();
	    return colTimetable;
	}
}








